package middleware

import "github.com/gin-gonic/gin"

var (
	allowVersion map[string]bool = map[string]bool{
		"v1": true,
	}
)

func VersionControl(context *gin.Context) {
	//version, _ := context.Params.Get("version")
	//isUse, exists := allowVersion[version]
	//if !exists || !isUse {
	//	context.JSON(404, gin.H{
	//		"code": 404,
	//		"msg":  "无效的版本",
	//	})
	//	context.Abort()
	//	return
	//}
	context.Set("version", "v1")
	context.Next()
}
